#include "stdafx.h"
#include ".\vector.h"

#include "stdlib.h"

double GenericMath::PoorMansGaussian()
{
	static const double lfScale = 1.0/(RAND_MAX);
	double lfResult = rand()*lfScale;
	lfResult = pi*(lfResult-0.5);
	lfResult = tan(lfResult);
	return 0.25*lfResult;
}

double GenericMath::PoorMansGaussian(double lfRandIn)
{
	double lfResult = pi*(lfRandIn-0.5);
	lfResult = tan(lfResult);
	return 0.25*lfResult;
}

double GenericMath::RandRange(double lfMin, double lfMax)
{
	static const double lfScale = 1.0/(RAND_MAX);
	double lfResult = rand()*lfScale;
	return lfMin+(lfMax-lfMin)*lfResult;
}




